﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="keywords" content="blazor,known,razor,react,vue,组件,dotnet">
    <meta name="description" content="Known是基于Blazor的企业级快速开发框架，低代码，跨平台，开箱即用，一处代码，多处运行。" />
    <base href="/" />
    <link rel="stylesheet" href="@Config.GetStaticFileUrl("_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css")" />
    <link rel="stylesheet" href="@Config.GetStaticFileUrl("_content/BootstrapBlazor/css/motronic.min.css")" />
    <link rel="stylesheet" href="@Config.GetStaticFileUrl("_content/Known.BootBlazor/css/web.css")" />
    <link rel="stylesheet" href="@Config.GetStaticFileUrl("_content/Known/css/web.css")" />
    <link rel="stylesheet" href="@Config.GetStaticFileUrl("css/app.css")" />
    <link rel="icon" type="image/png" href="favicon.png" />
    <link rel="manifest" href="manifest.json" />
    <link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
    <link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />
</head>
<body>
    <div class="loading"></div>
    <Routes @rendermode="InteractiveMode" IPAddress="@ipAddress" IsMobile="isMobile" />
    <script src="@Config.GetStaticFileUrl("_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js")"></script>
    <script src="_framework/blazor.web.js"></script>
    <script>navigator.serviceWorker.register('service-worker.js');</script>
</body>
</html>

@code {
    [CascadingParameter] private HttpContext HttpContext { get; set; } = default!;
    private InteractiveServerRenderMode InteractiveMode => new(false);
    //private InteractiveAutoRenderMode InteractiveMode => new(false);
    private string ipAddress;
    private bool isMobile;

    protected override void OnInitialized()
    {
        base.OnInitialized();
        Config.HostUrl = HttpContext.GetHostUrl();
        ipAddress = HttpContext.Connection?.RemoteIpAddress?.ToString();
        isMobile = HttpContext.CheckMobile();
    }
}